#include "designer/cxcontrolsdesignercollection.h"


#include <private/menu/cxisidebarmenu/cxisidebarmenu_p.h>
CxiSideBarMenuPrivate::CxiSideBarMenuPrivate(CxiSideBarMenu* q)
	: q_ptr(q)
	,m_mainLayout(new QVBoxLayout())
	,m_treeWidget(new QTreeWidget())
{
	init();
}
CxiSideBarMenuPrivate::~CxiSideBarMenuPrivate()
{
}
void CxiSideBarMenuPrivate::init()
{
	Q_Q(CxiSideBarMenu);
	m_treeWidget->setHeaderHidden(true);
	m_treeWidget->setRootIsDecorated(false);
	m_treeWidget->setIndentation(20);        // 缩进宽度
	m_treeWidget->setExpandsOnDoubleClick(true);
	m_treeWidget->setUniformRowHeights(true);
	m_treeWidget->setAllColumnsShowFocus(true);
	m_treeWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
	m_treeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	m_treeWidget->setItemDelegate(new FullRowDelegate());
	// m_treeWidget->setStyle(new NoFocusProxyStyle);
	QObject::connect(m_treeWidget,&QTreeWidget::itemClicked,
		q,&CxiSideBarMenu::onItemTriggered);

	m_mainLayout->setContentsMargins(0,0,0,0);
	m_mainLayout->setSpacing(0);

	m_mainLayout->addWidget(m_treeWidget);
	q->setLayout(m_mainLayout);
}